#include<iostream>
#include<fstream>
#include<string>
#include<vector>
#include"Student.h"
using namespace std;

int main()
{
    string na;
    int score;
    vector<Student> students;
    int i=0;
    int sum1=0,sum2=0,sum3=0;
    int max1=0,max2=0,max3=0;
    int min1=10000,min2=10000,min3=10000;
    float av1,av2,av3;

    ifstream input("input.txt");
    
    while (++i <= 10)
    {
        Student student;
        student.no=i;
        input >> student.name;
        input >> student.score1 >> student.score2 >> student.score3;
        student.average = (student.score1+student.score2+student.score3)/3.0;
        students.push_back(student);

        sum1 += student.score1;
        if(max1<student.score1){max1=student.score1;}
        if(min1>student.score1){min1=student.score1;}
        sum2 += student.score2;
        if(max2<student.score2){max2=student.score2;}
        if(min2>student.score2){min2=student.score2;}
        sum3 += student.score3;
        if(max3<student.score3){max3=student.score3;}
        if(min3>student.score3){min3=student.score3;}
        
    }
    av1=sum1/10.0;
    av2=sum2/10.0;
    av3=sum3/10.0;

    cout << "no\tname\tscore1\tscore2\tscore3\taverage\t"<< endl;
    for (const auto& student : students) {
        cout << student.no << "\t" << student.name << "\t" << student.score1 << "\t" << student.score2 << "\t" << student.score3 << "\t" << student.average << "\t" << endl;
    }
    cout << "\taverage" << "\t" << av1 << "\t" << av2 << "\t" << av3 << endl;
    cout << "\tmin" << "\t" << min1 << "\t" << min2 << "\t" << min3 << endl;
    cout << "\tmax" << "\t" << max1 << "\t" << max2 << "\t" << max3 << endl;
    return 0;
}
